
package com.csc440.team2.communication;

import com.csc440.team2.smil.SMILMessage;


/**
 * Primary communication class for sending messages through the server
 * 
 * @author Jeremy Spitzig
 */
public class CommunicationManager
{
    /**
     * Sends the provided smil message to the given receiver
     * 
     * @param message message to send
     * @param reciever reciever whom will receive the message
     */
    public static void sendSMILMessage(SMILMessage message, String reciever)
    {
        Thread handlerThread;
        ClientHandler handler = new ClientHandler();
        handler.setAction(MessageAction.SEND);

        // TODO this should be a property that can be configured externally
        handler.setPort(23432);
        handler.setReciever(reciever);
        handler.setSMILMessage(message);
        handlerThread = new Thread(handler);
        handlerThread.start();
    }
}
